<?php

/**
 * user actions.
 *
 * @package    maiphoto
 * @subpackage user
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class userActions extends sfActions {

    public function executeShow(sfWebRequest $request) {
        $this->user = Doctrine_Core::getTable('User')->find(array($request->getParameter('id')));
        $this->forward404Unless($this->user);
        
        $this->photoForm = new PhotoForm();
    }

    protected function processForm(sfWebRequest $request, sfForm $form) {
        $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
        if ($form->isValid()) {
            $user = $form->save();

            $this->redirect('user/edit?id=' . $user->getId());
        }
    }

}
